/**
 *
 */
package com.wateray.ipassbook.ui.model;

import java.util.Vector;

import com.wateray.ipassbook.domain.form.PassbookForm;

/**
 * @author c-bryu
 *
 */
public class PassbookTableModel extends AbstractPassbookTableModel {
        /**
         *serialVersionUID
         */
        private static final long serialVersionUID = 1L;


        public PassbookTableModel(Vector<String> columnNames){
                super(columnNames);
        }
       
        public PassbookTableModel(Vector dataVector,
                        Vector<String> columnNames) {
                super(dataVector, columnNames);
                // TODO Auto-generated constructor stub
        }
       

        /* (non-Javadoc)
         * @see javax.swing.table.TableModel#getValueAt(int, int)
         */
        @Override
        public Object getValueAt(int rowIndex, int columnIndex) {
                // TODO Auto-generated method stub
                Object value = null;
        if(this.getRowCount()<=0)
                return null;
        PassbookForm entity = (PassbookForm) (dataVector.get(rowIndex));

                switch (columnIndex) {
                case 0:
                        value = rowIndex + 1;
                        break;
                case 1:
                        value = entity.getPassbookId();
                        break;
                case 2:
                        value = entity.getPassbookSubId();
                        break;
                case 3:
                        value = entity.getPassbookName();
                        break;
                case 4:
                        value = entity.getCapital();
                        break;
                case 5:
                        value = entity.getBalance();
                        break;
                case 6:
                        value = entity.getCurrencyName();
                        break;
                case 7:
                        value = entity.getMemo();
                        break;
                }
                return value;
        }

}
